package cmo.neutech.day13.dome2;

import java.util.LinkedList;
import java.util.ListIterator;

public class bookText {
    public static void main(String[] args) {
        LinkedList<book> b1 = new LinkedList<>();
        LinkedList<book> b2 = new LinkedList<>();
        int count = 0;
        b1.add(new book("1",100,"小说","张三"));
        b1.add(new book("2",200,"小说","李四"));
        b1.add(new book("3",300,"小说","王五"));
        b1.add(new book("4",400,"小说","赵六"));
        b2.add(new book("1",100,"小说","张三"));
        b2.add(new book("2",300,"小说","魏六"));
        for(book b:b1){
            for(book c:b2){
                if(b.toString().equals(c.toString())){
                    count++;
                    System.out.println(c);
                }
            }
        }
        System.out.println("重复了"+count+"个");
        ListIterator<book> it = b1.listIterator();
        while (it.hasNext()){
            System.out.println(it.next());
        }
        for(book b:b2){
            System.out.println(b.toString());
        }
    }

}
